package com.demo2do.fms.admin.service.data.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.demo2do.core.persistence.GenericDaoSupport;
import com.demo2do.core.persistence.annotation.Dao;
import com.demo2do.fms.admin.dao.data.DefaultOilTypeDao;
import com.demo2do.fms.admin.service.data.DefaultOilTypeService;
import com.demo2do.fms.entity.data.cost.DefaultOilType;

/**
 * 
 * @author Wy
 *
 */
@Service("defaultOilTypeService")
public class DefaultOilTypeServiceImpl implements DefaultOilTypeService{
    
    @Autowired
    private GenericDaoSupport genericDaoSupport;

    @Dao 
    private DefaultOilTypeDao defaultOilTypeDao;
    
    /* (non-Javadoc)
     * @see com.demo2do.fms.admin.service.data.DefaultOilTypeService#count(java.util.List)
     */
    public int count(List<Long> orgIds) {
    	return defaultOilTypeDao.count(orgIds);
    }
    
    /* (non-Javadoc)
     * @see com.demo2do.fms.admin.service.data.DefaultOilTypeService#list(java.util.List)
     */
    public List<DefaultOilType> list(List<Long> orgIds) {
        return defaultOilTypeDao.list(orgIds);
    }
    
    /* (non-Javadoc)
     * @see com.demo2do.fms.admin.service.data.DefaultOilTypeService#load(java.lang.Long)
     */
    public DefaultOilType load(Long orgId) {
        return genericDaoSupport.load(DefaultOilType.class, orgId);
    }
    
    /* (non-Javadoc)
     * @see com.demo2do.fms.admin.service.data.DefaultOilTypeService#getDefaultOilTypeId(java.lang.Long)
     */
    public Long getDefaultOilTypeId(Long orgId) {
        DefaultOilType defaultOilType = this.load(orgId);
        return defaultOilType.getOilTypeId();
    }
    
    /* (non-Javadoc)
     * @see com.demo2do.fms.admin.service.data.DefaultOilTypeService#edit(java.lang.Long, java.lang.Long)
     */
    public void edit(Long orgId, Long oilTypeId) {
        defaultOilTypeDao.update(orgId, oilTypeId);
    }

}
